package com.aaa.controller;


import com.aaa.entity.CourseAudit;
import com.aaa.entity.EduCourse;
import com.aaa.service.ICourseAuditService;
import com.aaa.service.ICourseIntroduceService;
import com.aaa.service.IEduCourseService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.time.LocalDateTime;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zyd
 * @since 2021-03-24
 */
@RestController
@RequestMapping("/course-audit")
public class CourseAuditController {
    @Resource
    private IEduCourseService courseService;
    @Resource
    private ICourseAuditService auditService;
    @PostMapping("/audit")
    public  boolean audit(EduCourse course, CourseAudit audit){
        audit.setVtime(LocalDateTime.now());
        return courseService.updateById(course)&&auditService.save(audit);
    }
    @PostMapping("/audit1")
    public  boolean audit1(EduCourse course){
        System.out.println("!!!!");
        return courseService.updateById(course);
    }
}

